<?php

/**
 * siteconfig filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasesiteconfigFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ClassName'             => new sfWidgetFormChoice(array('choices' => array('' => '', 'SiteConfig' => 'SiteConfig'))),
      'Created'               => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'LastEdited'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'Title'                 => new sfWidgetFormFilterInput(),
      'Tagline'               => new sfWidgetFormFilterInput(),
      'Theme'                 => new sfWidgetFormFilterInput(),
      'CanViewType'           => new sfWidgetFormChoice(array('choices' => array('' => '', 'Anyone' => 'Anyone', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
      'CanEditType'           => new sfWidgetFormChoice(array('choices' => array('' => '', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
      'CanCreateTopLevelType' => new sfWidgetFormChoice(array('choices' => array('' => '', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
    ));

    $this->setValidators(array(
      'ClassName'             => new sfValidatorChoice(array('required' => false, 'choices' => array('SiteConfig' => 'SiteConfig'))),
      'Created'               => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'LastEdited'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'Title'                 => new sfValidatorPass(array('required' => false)),
      'Tagline'               => new sfValidatorPass(array('required' => false)),
      'Theme'                 => new sfValidatorPass(array('required' => false)),
      'CanViewType'           => new sfValidatorChoice(array('required' => false, 'choices' => array('Anyone' => 'Anyone', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
      'CanEditType'           => new sfValidatorChoice(array('required' => false, 'choices' => array('LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
      'CanCreateTopLevelType' => new sfValidatorChoice(array('required' => false, 'choices' => array('LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers'))),
    ));

    $this->widgetSchema->setNameFormat('siteconfig_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'siteconfig';
  }

  public function getFields()
  {
    return array(
      'ID'                    => 'Number',
      'ClassName'             => 'Enum',
      'Created'               => 'Date',
      'LastEdited'            => 'Date',
      'Title'                 => 'Text',
      'Tagline'               => 'Text',
      'Theme'                 => 'Text',
      'CanViewType'           => 'Enum',
      'CanEditType'           => 'Enum',
      'CanCreateTopLevelType' => 'Enum',
    );
  }
}
